package com.jcl.recruit.resume.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.resume.mapper.ResumeEduMapper;
import com.jcl.recruit.resume.model.ResumeEdu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


@Component
public class ResumeEduDao implements ResumeEduMapper {

    @Autowired
    private ResumeEduMapper resumeEduMapper;

    @Override
    public List<ResumeEdu> findListByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.findListByResumeIds(corpCode, resumeIds);
    }

    @Override
    public List<ResumeEdu> findListByResumeId(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.findListByResumeId(corpCode, resumeId);
    }

    @Override
    public List<Map<String, Object>> findObjListByResumeId(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.findObjListByResumeId(corpCode, resumeId);
    }

    @Override
    public int isExitEntity(ResumeEdu entity) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.isExitEntity(entity);
    }

    @Override
    public int batchInsert(List<ResumeEdu> list) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.batchInsert(list);
    }

    @Override
    public int insert(ResumeEdu entity) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.insert(entity);
    }

    @Override
    public int updateByPrimaryKey(ResumeEdu entity) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.updateByPrimaryKey(entity);
    }

    @Override
    public int deleteById(Integer id) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.deleteById(id);
    }

    @Override
    public int batchDeleteByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumeEduMapper.batchDeleteByResumeIds(corpCode, resumeIds);
    }
}
